  {extend name="Public:base" /}
                       {block name="seo"}
         <title>文档上传|{$Think.CONFIG.WEB_SITE_TITLE} - Powered by EasySNS!</title>
  
  
  <meta name="keywords" content="{$Think.CONFIG.WEB_SITE_KEYWORD}">
  <meta name="description" content="{$Think.CONFIG.WEB_SITE_DESCRIPTION}">
      {/block}
  {block name="css"}
 <link rel="stylesheet" type="text/css" href="__PUBLIC__/js/webuploader/webuploader.css">
   <style>
.webuploader-pick {
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
    background-color: #fd8a23;
    border-color: #fd8a23;
    padding:10px 30px;
}
.webuploader-pick-hover {
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
    background-color: #ff9f49;
    border-color: #ff9f49;
}
  </style>
  {/block}
  {block name="extenddiv"}

  {/block}
    {block name="extenddivend"}

  {/block}
  {block name="body"}

<div id="upload-init-container" class="container" style="display: block;">
<div class="upload-hd-2017">
<div class="upload-hd"></div>
<div class="upload-steps clearfix">
<ul>
<li class="step-num active">1<span class="tips">选择文档</span>
</li>
<li class="step-bar"></li>
<li class="step-num">2<span class="tips">完善信息</span>
</li>
<li class="step-bar"></li>
<li class="step-num">3<span class="tips">完成上传</span>
</li>
</ul>
</div>
</div>
<div class="es-panel ">
<div class="mod mod-upload">

<div class="bd" style="">
<div>

<div class=" " id="flash-upload-wrap"><i class="iconfont icon-shangchuan2"></i> 上传文档</div>
</div>
<div class="progress" >
  <div class="progress-bar progress-bar-success" id="progressbar" style="width: 0%;">
    0%
  </div>
</div>
<p class="drag-tips">每成功上传一篇公开文档，可获取<span class="strongTips">{$point_tip}</span>奖励</p>

</div>
<p class="up-tips">从我的电脑选择要上传的文档,请上传无水印文档</p>
</div>


<div class="upload-notice">
<h4>温馨提示</h4>
<ol>
<li>1.您可以上传日常积累和撰写的文档资料，如模板、总结，支持多种文档类型：</li>
<li class="doc-type"><b class="ic ic-doc es-margin-r-5"></b>doc,docx<b class="ic ic-ppt es-margin-l-10 es-margin-r-5"></b>ppt,pptx<b class="ic ic-xls es-margin-l-10 es-margin-r-5"></b>xls,xlsx<b class="ic ic-vsd es-margin-l-10 es-margin-r-5"></b>vsd<b class="ic ic-pot es-margin-l-10 es-margin-r-5"></b>pot<b class="ic ic-pps es-margin-l-10 es-margin-r-5"></b>pps<b class="ic ic-rtf es-margin-l-10 es-margin-r-5"></b>rtf<br><b class="ic ic-wps es-margin-r-5"></b>wps<b class="ic ic-et es-margin-l-10 es-margin-r-5"></b>et<b class="ic ic-dps es-margin-l-10 es-margin-r-5"></b>dps<b class="ic ic-pdf es-margin-l-10 es-margin-r-5"></b>pdf<b class="ic ic-txt es-margin-l-10 es-margin-r-5"></b>txt<b class="ic ic-epub es-margin-l-10 es-margin-r-5"></b>epub</li>
<li>2.上传涉及侵权内容的文档将会被移除。如何判断文档是否侵权？
查看<a href="#" target="_blank">文库协议</a>和<a href="#" target="_blank">用户规则</a></li>
<li>3.上传有问题需要帮助？查看<a href="#" target="_blank">文库帮助</a>和<a href="#" target="_blank">意见反馈</a></li>
<li>4.为营造绿色网络环境，严禁上传含有淫秽色情及低俗信息等文档，让我们一起携手共同打造健康文库</li>
</ol>
</div>
</div>
</div>


  {/block}
      {block name="script"}
     
      <script type="text/javascript" src="__PUBLIC__/js/webuploader/webuploader.nolog.js"></script>
<script>
$(function(){
	
	var last_uploadid="{:session('last_uploadid')}";
	
	if(last_uploadid>0){
		layer.confirm('您还有未填写完成的文档，是否继续填写？',{icon:3, title:'提示信息'},function(index){
		   
		    location.href="{:url('Doc/docuploadinfo',array('xsid'=>$xsid))}";
			 
		});
		
		
	}
	
	 
	 
	 
	
	var uploader = WebUploader.create({

	    // swf文件路径
	    swf: "__PUBLIC__" + '/js/webuploader/Uploader.swf',

	    // 文件接收服务端。
	    server: "{:url('File/fileUpload')}",
	    auto:true,
	    fileNumLimit:1,
	    //fileSingleSizeLimit:2048000,
	   // chunked:true,
	    // 选择文件的按钮。可选。
	    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
	    pick: '#flash-upload-wrap',

	    // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
	    resize: false
	});
	//uploader.on( 'fileQueued', function( file ) {
	   // $('.bd').append( '<div id="' + file.id + '" class="item">' +
	       // '<h4 class="info">' + file.name + '</h4>' +
	       // '<p class="state">等待上传...</p>' +
	    //'</div>' );
	//});
	
	// 文件上传过程中创建进度条实时显示。
	uploader.on( 'uploadProgress', function( file, percentage ) {
	    
        $('.progress').show();
	    $('#progressbar').css( 'width', percentage * 100 + '%' );
	    $('#progressbar').html(percentage * 100 + '%' );
	});
	uploader.on( 'uploadSuccess', function( file,response ) {

		
		
		if(response.code==0){
			
			console.log(response);
			layer.msg(response.errormsg, {icon: 2, time: 1000}, function(){
				uploader.reset();
	        });
		}else{
		
			
			if(response.hasupload==1){
				
				layer.msg('该文档已有人上传', {icon: 2, time: 1000}, function(){
					uploader.reset();
		        });
				
			}else{
				
               
			
				
				layer.msg('上传成功', {icon: 1, time: 1000}, function(){
			          location.href="{:url('Doc/docuploadinfo',array('xsid'=>$xsid))}";
		        });
				
			}
			
			
			
				
		
			
			
			
			
		}
		
		
	});
	uploader.on( 'uploadError', function( file,reason ) {
		
		layer.msg('上传出错', {icon: 2, time: 1000}, function(){
			uploader.reset();
        });
	});
	uploader.on( 'error', function(reason ) {
		var msg;
		layer.msg('上传出错代码'+reason, {icon: 2, time: 1000}, function(){
			uploader.reset();
        });
		//if(reason=='F_EXCEED_SIZE'){
			//msg='';
		//}
	});

	uploader.on( 'uploadComplete', function( file ) {
		$('.progress').fadeOut();
	});
	
	

	
});

</script>
  {/block}